package com.qf.day13.map;

import com.sun.org.apache.bcel.internal.generic.NEW;

import java.util.Collection;
import java.util.HashMap;
import java.util.Set;

public class MapDemo {
    public static void main(String[] args) {
        HashMap<String,String>hashMap= new HashMap<>();
        hashMap.put("hello","你好");
        hashMap.put("hi","你好");
        System.out.println(hashMap);
        //获取键集合
        Set<String> strings = hashMap.keySet();
        System.out.println(strings);
        //获取值集合
        Collection<String> values = hashMap.values();
        System.out.println(values);
        //获取值
        String hi = hashMap.get("hi");
        System.out.println(hi);

    }
}
